#include<iostream>
using namespace std;
int main(){
    int n;
    while (cin>>n&&n>=1&&n<=30)
    {
        int a[30][30]={0};
        a[0][1]=1;
        cout<<a[0][1]<<endl;
        for (int i = 1; i < n; i++){
        for (int j =1;j<=i+1;j++){
            
            a[i][j]=a[i-1][j-1]+a[i-1][j];
            cout<<a[i][j];
            if(j!=i+1)cout<<" ";
        }
        cout<<endl;
    }
    cout<<endl;
        
    }
    }